﻿using System;
using System.Collections.Generic;
using Wala.Common.Profiles;
using Wala.Common.Contacts;
using common;
using Wala.Common.Chats;

namespace LocalDataBase
{
    public interface IWalaData
    {
        #region users table
        String GetStatus();

        void InsertUser(uint uid, string uname, string display_name, ulong avatar_id, ulong cover_id, uint gender);

        void UpdateUser(uint uid, string uname, string display_name, ulong avatar_id, ulong cover_id, uint gender);

        bool IsExistedUser(uint walaId);

        ulong GetAvatarId();

        bool HasLocalContactVersion();

        uint GetContactVersion();

        void UpdateContactVersion(uint contactVersion);

        #endregion

        #region WalaContact table
        bool IsExistedContact(uint walaId);

        void UpdateAlias(uint walaId, string alias);

        void InsertFriendWhenLoadContact(uint walaId, String uname, String alias);

        void InsertFriendWhenLoadContact(List<UserContactMsg> userContactMsgs);

        void DeleteContact(uint uid);

        void UpdateContactInfo(uint walaId, String displayName, String phone, ulong avatarId, ulong coverId, uint gender);

        void UpdateContactInfo(List<common.RetLoadFriendBasicMsg.FriendBasicInfo> friendBasicInfoList);

        void UpdateContactStatus(uint walaId, String status);

        void UpdateContactStatus(List<UserPresenceInfo> userPresenceInfoList);

        List<ContactBasic> GetAllContact();

        void UpdateLastMessage(uint friendId, bool isGroup, String body, bool isRead, int status, uint type, uint time, int lastMessageId);

        ContactBasic GetWalaContactById(uint friendId);

        String GetAliasOrDisplayName(uint friendId, String displayName);

        void InsertRecent(uint friendId, String displayName, SMS sms);

        void UpdateContactInfo(ShortProfile shortProfile);

        #endregion

        #region BlockUsers
        bool IsExistedBlockUser(uint walaId);

        void RemoveBlockedkUser(uint walaId);

        void InsertNewBlockUser(ShortProfile shortProfile);

        #endregion

        #region MessageArchives
        int InsertChatMessage(SMS sms);

        void UpdateBodyId(int messageId, int bodyId);

        void UpdateSendStatus(int messageid, int sendStatus);

        #endregion

        #region TextMessagesContent
        int InsertNewTextMessageContent(string body);
        #endregion
    }
}
